/**
 * 提供OS相关接口，比如kv和文件系统
 */
 var kv = require('kv');
 var fs = require('fs');
 
 function nSetKvValue(key, value) {
     return kv.setStorageSync(key, value);
 }
 
 function nGetKvValue(key) {
     return kv.getStorageSync(key);
 }
 
 function nRmKvKey(key) {
     return kv.removeStorageSync(key);
 }
 
 function nReadFile(path) {
     return fs.readSync(path);
 }
 
 function nWriteFile(path, data, option) {
     return fs.writeSync(path, data, option);
 }
 
 function nDeleteFile(path) {
     return fs.unlinkSync(path);
 }
 
 function nTotalSize() {
     return fs.totalSize();
 }
 
 function nUsedSize() {
     return fs.usedSize();
 }
 
 function nFreeSize() {
     return fs.freeSize();
 }
 
 module.exports =
 {
     nSetKvValue: nSetKvValue,
     nGetKvValue: nGetKvValue,
     nRmKvKey: nRmKvKey,
     nReadFile: nReadFile,
     nWriteFile: nWriteFile,
     nDeleteFile: nDeleteFile,
     nTotalSize: nTotalSize,
     nUsedSize: nUsedSize,
     nFreeSize: nFreeSize,
 }